<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="keywords" content="">
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1.0, user-scalable=no" />	
		<title>上海林业</title>
		<link rel="stylesheet" href="<?=base_url()?>public/css/bootstrap.min.css" />
		<link rel="stylesheet" href="<?=base_url()?>public/css/public.css" />
	</head>
	<body>
		<div class="bg vote-bg">
		</div>
		<div class="containe">
			<div class="vote-top"><img src="<?=base_url()?>public/img/bg-vote.jpg" alt="" /></div>
			<div class="vote-bd">
				
				

				
					<div>
						<div class="vote-list">
						    <div class="row vote-list-row">
						    	<?php foreach ($data as $key =>$item): ?>
							    <div class="col-xs-4 tx text-center" style="padding-bottom:50px;">
								    <div class="pic">
									    <a href="/public/players.html?id=<?=$item['id']?>"><img src="<?=base_url()?><?=$item['headimgurl']?>" alt="" /></a>
								    </div>
								    <p class="text-center word"><?=mb_substr($item['username'], 0,4)?></p>
								    <a href="#" onclick="vote(<?=$item['id']?>)" class="btn-xq">投票</a>
							    </div>
							    <?php endforeach; ?>
							    					
						    </div>					
						    <div class="vote-blank">
							    &nbsp;
						    </div>
					    </div>
					</div>
				
					



				</div>
			</div>
		</div>	
	</body>
</html>
<script type="text/javascript" src="/public/js/jquery-2.2.3.min.js" ></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="/public/js/jssdk.js"></script>
<script type="text/javascript">jssdk('共筑疫情防护墙，同圆生态家园梦。','共筑疫情防护墙，同圆生态家园梦。',window.location.href,'<?=base_url()?>public/img/share.jpg');</script>
<script type="text/javascript">
function vote(id){
	// $.post('<?=site_url("welcome/vote_count")?>/'+id,function(data){
	$.post('/welcome/vote_count/'+id,function(data){
		
		alert(data.message)
		if (data.code===-5 || data.code===0) {
			window.location.href="<?=site_url('welcome/ranking')?>";
		}
		
	},'json');
}
</script>